﻿
//收付款记录明细操作

var columnsSK =
            [
                { display: 'Key', name: 'ID', type: 'text', hide: 1 },
                { display: '收款金额', name: 'ReceivedMoney', mintWidth: 80, width: 120 }, //, type: 'int', mintWidth: 40, width: 100
                {display: '收款优惠', name: 'ReceivedMoneyPft', mintWidth: 80, width: 120 },
//{display: '本次付款金额', name: 'PaidMoney', mintWidth: 100, width: 140, type: 'selfDate' },
//  { display: '付款优惠', name: 'OmitMoney', mintWidth: 100, width: 140 },
// { display: '票据方式', name: 'InvoiceTypeName', mintWidth: 80, width: 140 },
//  { display: '多开税金', name: 'TaxMoney', mintWidth: 80, width: 120 },
//  { display: '多开发票金额', name: 'MoreTaxMoney', mintWidth: 150, width: 200 },
//  { display: '发票号码', name: 'InvoiceNO', mintWidth: 150, width: 200 },
                {display: '支付方式', name: 'PayTypeName', mintWidth: 150, width: 200 },
// { display: '单子状态', name: 'SettleState', mintWidth: 150, width: 200 },
// { display: '应付优惠', name: 'BillPayPft', mintWidth: 150, width: 200 },
// { display: '删除状态', name: 'DeleteState', mintWidth: 80, width: 140 },
// { display: '结算状态', name: 'SettleState', mintWidth: 80, width: 120 }
                 {display: '备注', name: 'Remarks', mintWidth: 150, width: 200 }
             ];
var columnsFK =
            [
                { display: 'Key', name: 'ID', type: 'text', hide: 1 },
// { display: '本次收款金额', name: 'ReceivedMoney', mintWidth: 80, width: 120 }, //, type: 'int', mintWidth: 40, width: 100
                {display: '本次付款金额', name: 'PaidMoney', mintWidth: 100, width: 140, type: 'selfDate' },
                { display: '付款优惠', name: 'OmitMoney', mintWidth: 100, width: 140 },
//{ display: '票据方式', name: 'InvoiceTypeName', mintWidth: 80, width: 140 },
// { display: '多开税金', name: 'TaxMoney', mintWidth: 80, width: 120 },
// { display: '多开发票金额', name: 'MoreTaxMoney', mintWidth: 150, width: 200 },
//   { display: '发票号码', name: 'InvoiceNO', mintWidth: 150, width: 200 },
                {display: '支付方式', name: 'PayTypeName', mintWidth: 150, width: 200 },
//     { display: '单子状态', name: 'SettleState', mintWidth: 150, width: 200 },
                {display: '应付优惠', name: 'BillPayPft', mintWidth: 150, width: 200 },
//                { display: '删除状态', name: 'DeleteState', mintWidth: 80, width: 140 },
// {display: '结算状态', name: 'SettleState', mintWidth: 80, width: 120 },
                 {display: '备注', name: 'Remarks', mintWidth: 150, width: 200 }
             ];
var manager;
//init controls
$(document).ready(function () {
    initligerGrid();
});

function initligerGrid() {
    manager = null;
    manager = $("#ReceivableItemsGrid").ligerGrid({
        columns: $("#SFBillType").val() == "0" ? columnsSK : columnsFK,
        //  title: '收付款记录明细',//不能要标题，修改的BUG，不在ligerui.min.js文件中，所以这个BUG还是存在
        showTitle: false,
        width: '100%',
        enabledSort: true,
        enabledEdit: true,
        //height: '99%',
        minHeight: '100px',
        checkbox: false,
        rownumbers: true,
        url: "../ReceivablePayable/GetJsonOfBillItems?billId=" + $("#ReceivablePayableBillID").val() + "&rand=" + Math.random()
    });
}
